Optimal. Leaf size=107 \[ \frac {\left (2 a^2 B+6 a b C+3 b^2 B\right ) \sin (c+d x)}{3 d}+\frac {1}{2} x \left (a^2 C+2 a b B+2 b^2 C\right )+\frac {a^2 B \sin (c+d x) \cos ^2(c+d x)}{3 d}+\frac {a (a C+2 b B) \sin (c+d x) \cos (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.29, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {4072, 4024, 4047, 2637, 4045, 8} \[ \frac {\left (2 a^2 B+6 a b C+3 b^2 B\right ) \sin (c+d x)}{3 d}+\frac {1}{2} x \left (a^2 C+2 a b B+2 b^2 C\right )+\frac {a^2 B \sin (c+d x) \cos ^2(c+d x)}{3 d}+\frac {a (a C+2 b B) \sin (c+d x) \cos (c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2637
Rule 4024
Rule 4045
Rule 4047
Rule 4072
Rubi steps
\begin {align*} \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \cos ^3(c+d x) (a+b \sec (c+d x))^2 (B+C \sec (c+d x)) \, dx\\ &=\frac {a^2 B \cos ^2(c+d x) \sin (c+d x)}{3 d}-\frac {1}{3} \int \cos ^2(c+d x) \left (-3 a (2 b B+a C)+\left (\left (-2 a^2-3 b^2\right ) B-6 a b C\right ) \sec (c+d x)-3 b^2 C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a^2 B \cos ^2(c+d x) \sin (c+d x)}{3 d}-\frac {1}{3} \int \cos ^2(c+d x) \left (-3 a (2 b B+a C)-3 b^2 C \sec ^2(c+d x)\right ) \, dx-\frac {1}{3} \left (-2 a^2 B-3 b^2 B-6 a b C\right ) \int \cos (c+d x) \, dx\\ &=\frac {\left (2 a^2 B+3 b^2 B+6 a b C\right ) \sin (c+d x)}{3 d}+\frac {a (2 b B+a C) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a^2 B \cos ^2(c+d x) \sin (c+d x)}{3 d}-\frac {1}{2} \left (-2 a b B-a^2 C-2 b^2 C\right ) \int 1 \, dx\\ &=\frac {1}{2} \left (2 a b B+a^2 C+2 b^2 C\right ) x+\frac {\left (2 a^2 B+3 b^2 B+6 a b C\right ) \sin (c+d x)}{3 d}+\frac {a (2 b B+a C) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a^2 B \cos ^2(c+d x) \sin (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.29, size = 90, normalized size = 0.84 \[ \frac {6 (c+d x) \left (a^2 C+2 a b B+2 b^2 C\right )+3 \left (3 a^2 B+8 a b C+4 b^2 B\right ) \sin (c+d x)+a^2 B \sin (3 (c+d x))+3 a (a C+2 b B) \sin (2 (c+d x))}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 85, normalized size = 0.79 \[ \frac {3 \, {\left (C a^{2} + 2 \, B a b + 2 \, C b^{2}\right )} d x + {\left (2 \, B a^{2} \cos \left (d x + c\right )^{2} + 4 \, B a^{2} + 12 \, C a b + 6 \, B b^{2} + 3 \, {\left (C a^{2} + 2 \, B a b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.24, size = 254, normalized size = 2.37 \[ \frac {3 \, {\left (C a^{2} + 2 \, B a b + 2 \, C b^{2}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (6 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 4 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.94, size = 114, normalized size = 1.07 \[ \frac {\frac {B \,a^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+2 B a b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+b^{2} B \sin \left (d x +c \right )+2 C a b \sin \left (d x +c \right )+b^{2} C \left (d x +c \right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.34, size = 108, normalized size = 1.01 \[ -\frac {4 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{2} - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a^{2} - 6 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a b - 12 \, {\left (d x + c\right )} C b^{2} - 24 \, C a b \sin \left (d x + c\right ) - 12 \, B b^{2} \sin \left (d x + c\right )}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.73, size = 115, normalized size = 1.07 \[ \frac {C\,a^2\,x}{2}+C\,b^2\,x+\frac {3\,B\,a^2\,\sin \left (c+d\,x\right )}{4\,d}+\frac {B\,b^2\,\sin \left (c+d\,x\right )}{d}+B\,a\,b\,x+\frac {B\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {C\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {2\,C\,a\,b\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a\,b\,\sin \left (2\,c+2\,d\,x\right )}{2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________